<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Model;

class DepartmentStaff extends Model
{
    use HasDateTimeFormatter;
    protected $fillable = ['dwdm', 'name', 'order', 'type', 'filepath', 'creatd_at', 'updated_at'];
    protected $table = 'department_staffs';

    public static function getStaffsByDwdm($dwdm)
    {
        return DepartmentStaff::query()->where('dwdm', $dwdm)->orderBy('order', 'asc')->get();
    }
    
}